<div align="center">
	<?
		if($loi != ""){
			echo "<ul>\n";
				foreach ($loi as $error){
					echo "<li>$error<li>\n";
				}
			echo "</ul>\n";
		}
	?>
	<form action="index.php?module=xe&action=edit&id=<?php echo $id; ?>" enctype="multipart/form-data" method="POST">
		<table>
			<tr>
				<td>Ten hang</td>
				<td>
					<select name="hang">
						<?php
							$hang = new mhangxe();
							$data = $hang->hangxe();
							foreach($data as $row){
								if($row1["hang_id"] == $row["hang_id"]){
									echo "<option value='$row[hang_id]' selected='selected'>$row[tenhang]</option>";
								}else{
									echo "<option value='$row[hang_id]'>$row[tenhang]</option>";
								}
							}
						?>
					</select>
				</td>
			</tr>
			<tr>
				<td>Loai xe</td>
				<td>
					<select name="loai">
						<?php
							$loai = new mloai();
							$data = $loai->listloai();
							foreach($data as $row){
								if($row1["loai_id"] == $row["loaixe_id"]){
									echo "<option value='$row[loaixe_id]' selected='selected'>$row[tenloai]</option>";
								}else{
									echo "<option value='$row[loaixe_id]'>$row[tenloai]</option>";
								}
							}
						?>
					</select>
				</td>
			</tr>
			<tr>
				<td>Trang thai</td>
				<td>
					<select name="tt">
						<?php
							$tt = new mtrangthai();
							$data = $tt->show();
							foreach($data as $row){
								if($row1["loaitt_id"] == $row["loaitt_id"]){
									echo "<option value='$row[loaitt_id]' selected='selected'>$row[tentt]</option>";
								}else{
									echo "<option value='$row[loaitt_id]'>$row[tentt]</option>";
								}
							}
						?>
					</select>
				</td>
			</tr>
			<tr>
				<td>Ten xe</td>
				<td><input type="text" name="xe" value="<?php echo $row1['tenxe']; ?>" /></td>
			</tr>
			<tr>
				<td>Hinh anh</td>
				<td>
					<img src="<?php echo $row1['hinhanh']; ?>" width='70px' height='70px' />
					<input type="file" name="img" />
				</td>
			</tr>
			<tr>
				<td>Kiem duyet</td>
				<td>
					<input type="radio" name="kiemduyet" value="N" <?php if($row1['kiemduyet'] == 'N') echo "checked='checked'"?> />No
					<input type="radio" name="kiemduyet" value="Y" <?php if($row1['kiemduyet'] == 'Y') echo "checked='checked'"?> />Yes
				</td>
			</tr>
			<tr>
				<td>Gia</td>
				<td><input type="text" name="gia" value="<?php echo $row1['gia']; ?>" /></td>
			</tr>
			<tr>
				<td>&nbsp</td>
				<td><input type="submit" name="ok" value="Edit" /></td>
			</tr>
		</table>
	</form>
</div>